package com.atguigu.lease.common.utils;

import java.util.Random;

/**
 * @author XC
 * @version 1.0
 * @description
 * @knowledge
 */
// 生成验证码的工具类
public class VerifyCodeUtil {
    public static String generateVerifyCode(int len) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < len; i++) {
            /*
            int random = (int) (Math.random() * 10);
            sb.append(random);
            */
            sb.append(new Random().nextInt(10));
        }
        return sb.toString();
    }
}
